# 代码结果：
    # Handling request in ConcreteStateA
    # Handling request in ConcreteStateB
    # Handling request in ConcreteStateC

from abc import ABC, abstractmethod

# 抽象状态类
class State(ABC):
    @abstractmethod
    def handle(self) -> None:
        pass

# 具体状态类 A
class ConcreteStateA(State):
    def handle(self) -> None:
        print("Handling request in ConcreteStateA")

# 具体状态类 B
class ConcreteStateB(State):
    def handle(self) -> None:
        print("Handling request in ConcreteStateB")

# 具体状态类 C
class ConcreteStateC(State):
    def handle(self) -> None:
        print("Handling request in ConcreteStateC")

# 上下文类
class Context:
    def __init__(self, state: State):
        self.state = state

    def handle_request(self) -> None:
        self.state.handle()

# 客户端使用示例
if __name__ == "__main__":
    state_a = ConcreteStateA()
    context = Context(state_a)
    context.handle_request()

    state_b = ConcreteStateB()
    context.state = state_b
    context.handle_request()

    state_c = ConcreteStateC()
    context.state = state_c
    context.handle_request()